﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace VisualExamEngine
{
    public partial class frmMoveTo : Form
    {
        private frmMain MainForm;

        public frmMoveTo(frmMain MainForm)
        {
            InitializeComponent();

            this.MainForm = MainForm;
        }

        /// <summary>
        /// DateTime: 5/15/15 1:50 PM
        /// Author: Mike Hartwig
        /// Purpose: Close the form
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnCancel_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        /// <summary>
        /// DateTime: 5/16/15 1:50 PM
        /// Author: Mike Hartwig
        /// Purpose: Load all sub exams
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void frmMoveTo_Load(object sender, EventArgs e)
        {
            this.btnOK.Enabled = false;

            frmMdiChild child = (frmMdiChild)MainForm.ActiveMdiChild;

            foreach (TreeNode t in child.trvExamExplorer.Nodes)
            {
                if (t.Level == 0)
                {
                    this.cmbSubExam.Items.Add(t.Text);
                }
            }
        }

        /// <summary>
        /// DateTime: 5/16/15 2:50 PM
        /// Author: Mike Hartwig
        /// Purpose: User selected a sub exam
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void cmbSubExam_SelectedIndexChanged(object sender, EventArgs e)
        {
            this.btnOK.Enabled = true;
        }
    }
}
